<?php

/**
 * Project form base class.
 *
 * @package    albergue
 * @subpackage form
 * @author     Desarrollo Ce.S.P.I.
 */
abstract class BaseFormPropel extends sfFormPropel
{
  public function setup()
  {
    $formatter = new pmWidgetFormSchemaFormatterTable($this);
    $this->getWidgetSchema()->addFormFormatter("pm_table", $formatter);
    $this->getWidgetSchema()->setFormFormatterName("pm_table");
    
    $this->unsetFields();
    
    $this->configureWidgets();
    $this->configureValidators();
    
    // auto configure widgets
    WidgetFactory::replaceWidgets($this);
    // auto configure validators
    ValidatorFactory::replaceValidators($this);
    
    $this->configureWidgets();
    $this->configureValidators();
  }
  
  public function unsetFields() {}
  
  public function configureWidgets() {}
  
  public function configureValidators() {}
}
